Modern browsers provide an eventing application programming interface (API) for document object model (DOM) elements or for the whole browser window. That is, various user actions, such as clicking on an application button, cause the browser to generate an event. Some of these actions have “begin” and “end” events. These events specify the state of the action, i.e., whether the action has just started or ended. For example, when a user uses the mouse to click a DOM element, two events are sent: the first is the mouse down event and the second is the mouse up event. The first event indicates that the user has started interacting with the DOM element with the mouse, while the second event indicates that the user has finished interacting with the DOM element with the mouse. The same mechanism is used when a user presses a keyboard key. In this case, the two generated events are key up and key down events.
Some actions, however, have no end events, i.e., the application receives an indication that an interaction with a DOM element has started, but it has no indication whether the interaction with the DOM element has ended. Some of these actions are continuous actions, i.e., they execute the same begin event in series but do not execute an end event. For example, the browser generates a “scroll” event each time the user scrolls a page, but the application does not know whether the user has stopped scrolling the page, since no end event is sent when the user stops scrolling. In addition, the scroll event may be generated a few or many times during the scroll, and the number of times that the scroll event is generated is not consistent across the different browsers.